import * as types from './mutation-types'

export default {
    /*
    * 初始化用户数据
    * */
    [types.INIT_USER_INFO](state, o) {
        state.baseInfo.loginStatus = true;
        state.baseInfo.nickName = o.nickName;
        state.baseInfo.realName = o.realName;
        state.baseInfo.avatar = o.userAvatar;
        state.baseInfo.levelName = o.levelName;
        state.baseInfo.levelValue = o.levelValue;
    },
    /**
     * 完善用户资料
     * 
     */
    [types.COMPLETE_USER_INFO](state, o) {
        state.baseInfo.nickName = o.nickName;
        state.baseInfo.avatar = o.avatar;
        state.baseInfo.phone = o.phone;
    },
    /*
    * 修改用户子项
    * */
    [types.UPDATE_USER_INFO](state, o) {
        state.baseInfo[o.name] = o.value;
    }
}